    var shorten = function (array, number) {
      // remove 'number' characters from the end of 'array', in place (no return)
      for (var i = number; i > 0; i--) { array.pop(); };
    };
    var rstrip = function (string, character) {
      // strip trailing 'character' characters from the end of the string 'string'
      var i = string.length;
      while (string[i - 1] === character) { i--; };
      return string.slice(0, i);
    };
     
    var ascii85 = this.ascii85 = (function () {
      var ascii85 = {};
      ascii85.Ascii85CodecError = function (message) { this.message = message; };
      ascii85.Ascii85CodecError.prototype.toString = function () {
        return 'Ascii85CodecError' + (this.message ? ': ' + this.message : '');
      };
      var assertOrBadInput = function (expression, message) {
        if (!expression) { throw new ascii85.Ascii85CodecError(message) };
      };
      
      
      
      ascii85.encode = function (bytes) {
        assertOrBadInput(!(/[^\x00-\xFF]/.test(bytes)), 'Input contains out-of-range characters.'); // disallow two-byte chars
        var padding = '\x00\x00\x00\x00'.slice((bytes.length % 4) || 4);
        bytes += padding; // pad with null bytes
        var out_array = [];
        for (var i=0, n=bytes.length; i < n; i+=4) {
          var newchars = (
            (bytes.charCodeAt(i)   << 030) +
            (bytes.charCodeAt(i+1) << 020) +
            (bytes.charCodeAt(i+2) << 010) +
            (bytes.charCodeAt(i+3)));
          if (newchars === 0) {
            out_array.push(0x7a); // special case: 4 null bytes -> 'z'
            continue;
          };
          var char1, char2, char3, char4, char5;
          char5 = newchars % 85; newchars = (newchars - char5) / 85;
          char4 = newchars % 85; newchars = (newchars - char4) / 85;
          char3 = newchars % 85; newchars = (newchars - char3) / 85;
          char2 = newchars % 85; newchars = (newchars - char2) / 85;
          char1 = newchars % 85;
          out_array.push(char1 + 0x21, char2 + 0x21, char3 + 0x21,
                         char4 + 0x21, char5 + 0x21);
        };
        shorten(out_array, padding.length);
        return '<~' + String.fromCharCode.apply(String, out_array) + '~>'
      };
      
      
      
      ascii85.decode = function (a85text) { // Them ten ham link1 de giau ten
        assertOrBadInput ((a85text.slice(0,2) === '<~') && (a85text.slice(-2) === '~>'), 'Invalid initial/final ascii85 characters');
        // kill whitespace, handle special 'z' case
        a85text = a85text.slice(2,-2).replace(/\s/g, '').replace('z', '!!!!!');
        assertOrBadInput(!(/[^\x21-\x75]/.test(a85text)), 'Input contains out-of-range characters.');
        var padding = '\x75\x75\x75\x75\x75'.slice((a85text.length % 5) || 5);
        a85text += padding; // pad with 'u'
        var newchars, out_array = [];
        var pow1 = 85, pow2 = 85*85, pow3 = 85*85*85, pow4 = 85*85*85*85;
        for (var i=0, n=a85text.length; i < n; i+=5) {
          newchars = (
            ((a85text.charCodeAt(i)   - 0x21) * pow4) +
            ((a85text.charCodeAt(i+1) - 0x21) * pow3) +
            ((a85text.charCodeAt(i+2) - 0x21) * pow2) +
            ((a85text.charCodeAt(i+3) - 0x21) * pow1) +
            ((a85text.charCodeAt(i+4) - 0x21)));
          out_array.push(
            (newchars >> 030) & 0xFF,
            (newchars >> 020) & 0xFF,
            (newchars >> 010) & 0xFF,
            (newchars)        & 0xFF);
        };
        shorten(out_array, padding.length);
        return String.fromCharCode.apply(String, out_array);
      };
      return ascii85;
    })();

    



function encryptASCII85() {
    document.getElementById("resulttext").innerHTML = "Kết quả Mã hóa:";
    document.helloximoASCII85.T2ASCII85.value = ascii85.encode(document.helloximoASCII85.T1ASCII85.value);
    return !1
}
function decryptASCII85() {
    document.getElementById("resulttext").innerHTML = "Kết quả Giải mã:";
    document.helloximoASCII85.T2ASCII85.value = ascii85.decode(document.helloximoASCII85.T1ASCII85.value);
    return !1
}






// Tương tự như trên không khác gì, chỉ thay đổi tên hàm để dấu tên

   var shorten = function (array, number) {
      // remove 'number' characters from the end of 'array', in place (no return)
      for (var i = number; i > 0; i--) { array.pop(); };
    };
    var rstrip = function (string, character) {
      // strip trailing 'character' characters from the end of the string 'string'
      var i = string.length;
      while (string[i - 1] === character) { i--; };
      return string.slice(0, i);
    };
     
    var link1 = this.link1 = (function () {
      var link1 = {};
      link1.Ascii85CodecError = function (message) { this.message = message; };
      link1.Ascii85CodecError.prototype.toString = function () {
        return 'Ascii85CodecError' + (this.message ? ': ' + this.message : '');
      };
      var assertOrBadInput = function (expression, message) {
        if (!expression) { throw new link1.Ascii85CodecError(message) };
      };
      link1.encode = function (bytes) {
        assertOrBadInput(!(/[^\x00-\xFF]/.test(bytes)), 'Input contains out-of-range characters.'); // disallow two-byte chars
        var padding = '\x00\x00\x00\x00'.slice((bytes.length % 4) || 4);
        bytes += padding; // pad with null bytes
        var out_array = [];
        for (var i=0, n=bytes.length; i < n; i+=4) {
          var newchars = (
            (bytes.charCodeAt(i)   << 030) +
            (bytes.charCodeAt(i+1) << 020) +
            (bytes.charCodeAt(i+2) << 010) +
            (bytes.charCodeAt(i+3)));
          if (newchars === 0) {
            out_array.push(0x7a); // special case: 4 null bytes -> 'z'
            continue;
          };
          var char1, char2, char3, char4, char5;
          char5 = newchars % 85; newchars = (newchars - char5) / 85;
          char4 = newchars % 85; newchars = (newchars - char4) / 85;
          char3 = newchars % 85; newchars = (newchars - char3) / 85;
          char2 = newchars % 85; newchars = (newchars - char2) / 85;
          char1 = newchars % 85;
          out_array.push(char1 + 0x21, char2 + 0x21, char3 + 0x21,
                         char4 + 0x21, char5 + 0x21);
        };
        shorten(out_array, padding.length);
        return '<~' + String.fromCharCode.apply(String, out_array) + '~>'
      };
     
     
      link1.link1 = function (a85text) {
        assertOrBadInput ((a85text.slice(0,2) === '<~') && (a85text.slice(-2) === '~>'), 'Invalid initial/final link1 characters');
        // kill whitespace, handle special 'z' case
        a85text = a85text.slice(2,-2).replace(/\s/g, '').replace('z', '!!!!!');
        assertOrBadInput(!(/[^\x21-\x75]/.test(a85text)), 'Input contains out-of-range characters.');
        var padding = '\x75\x75\x75\x75\x75'.slice((a85text.length % 5) || 5);
        a85text += padding; // pad with 'u'
        var newchars, out_array = [];
        var pow1 = 85, pow2 = 85*85, pow3 = 85*85*85, pow4 = 85*85*85*85;
        for (var i=0, n=a85text.length; i < n; i+=5) {
          newchars = (
            ((a85text.charCodeAt(i)   - 0x21) * pow4) +
            ((a85text.charCodeAt(i+1) - 0x21) * pow3) +
            ((a85text.charCodeAt(i+2) - 0x21) * pow2) +
            ((a85text.charCodeAt(i+3) - 0x21) * pow1) +
            ((a85text.charCodeAt(i+4) - 0x21)));
          out_array.push(
            (newchars >> 030) & 0xFF,
            (newchars >> 020) & 0xFF,
            (newchars >> 010) & 0xFF,
            (newchars)        & 0xFF);
        };
        shorten(out_array, padding.length);
        return String.fromCharCode.apply(String, out_array);
      };
      return link1;
    })();

